<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/', function () {
    return view('index');
});
$router->group(['prefix' => 'api'], function () use ($router) {
    $router->post('page/preview', 'Controller@preview');
    $router->post('page/list', 'PageController@publishedList');
    $router->post('page/del', 'PageController@delete');
    $router->post('upload/image-token', 'UploadController@imageToken');
    $router->post('page/pub', 'PublishController@publish');
    $router->post('user/login', 'LoginController@login');
    $router->post('user/verify-login-code', 'LoginController@sendVerifyCode');
    $router->post('user/info', 'LoginController@user');
    $router->post('form/submit','FormController@submit');
    $router->post('form/list-by-page','FormController@listByPageSqId');
    $router->post('form/data-by-form-id', 'FormController@dataByFormId');
});

$router->get('/page/{sqId}','PageController@show');
$router->post('/page-json/{sqId}','PageController@json');
